package com.itheima.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.entity.YddAdvimg;
import com.itheima.mapper.YddAdvimgMapper;
import com.itheima.service.YddAdvimgService;
import org.springframework.stereotype.Service;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.entity.YddAdvimg;
import com.itheima.mapper.AdvimgMapper;

import com.itheima.service.YddAdvimgService;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author author
 * @since 2022-05-23
 */
@Service
public class YddAdvimgServiceImpl extends ServiceImpl<YddAdvimgMapper, YddAdvimg> implements YddAdvimgService {

    @Override
    public List<YddAdvimg> getbanner() {
        //首页轮播图
        LambdaQueryWrapper<YddAdvimg> lqw = new LambdaQueryWrapper<>();
        lqw.eq(YddAdvimg::getAdvimgpos,"15");
        List<YddAdvimg> bannerlist = this.list(lqw);
        return bannerlist;
    }

    @Override
    public List<YddAdvimg> getshowbanner() {
        //其他都是详情页广告位
        LambdaQueryWrapper<YddAdvimg> lqw = new LambdaQueryWrapper<>();
        lqw.ne(YddAdvimg::getAdvimgpos,"15").ne(YddAdvimg::getAdvimgpos,"14");
        List<YddAdvimg> showbannerlist = this.list(lqw);
        return showbannerlist;
    }

    @Override
    public List<YddAdvimg> getsidebanner() {
        //首页右侧广告
        LambdaQueryWrapper<YddAdvimg> lqw = new LambdaQueryWrapper<>();
        lqw.eq(YddAdvimg::getAdvimgpos,"14");
        List<YddAdvimg> sidebannerlist = this.list(lqw);
        return sidebannerlist;
    }
}
